<?php
class PictureForm extends Zend_Form
{
    public function __construct($options = null)
    {
        $this->addElementPrefixPath('App', 'App/');
    	parent::__construct($options);
        $this->setName('picture');
        $this->setAttrib('enctype', 'multipart/form-data');

        $title = new Zend_Form_Element_Text('title');
        $title
            ->setLabel('Title')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addValidator('NotEmpty')
            ;

        $description = new Zend_Form_Element_Textarea('description');
        $description
            ->setLabel('Description')
            //->setRequired(true)
            //->addValidator('NotEmpty')
            ;

        $file = new App_Form_Element_File('file');
        $file->setLabel('File')
                 ->setRequired(true)
                 ->addValidator('NotEmpty')
                 ;

        $article_id = new Zend_Form_Element_Select('article_id');
        $article_id
            ->setLabel('Related article')
            ->setRequired(true)
            ->addValidator('NotEmpty')
            ;

        $place = new Zend_Form_Element_Text('place');
        $place
            ->setLabel('Place')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addValidator('NotEmpty')
            ;

        $submit = new Zend_Form_Element_Submit('submit');
        $submit
            ->setOrder(7);

        $this->addElements(
            array($title, $description, $article_id, $place, $file, $submit)
        );
    }
}
?>